﻿using Approval.Domain;
using Approval.ReadAPI.Appliaction.Command.PayRelationCommand;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Approval.ReadAPI.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class PayRelationController : ControllerBase
    {
        private readonly IMediator mediator;

        public PayRelationController(IMediator mediator)
        {
            this.mediator = mediator;
        }

        /// <summary>
        /// 审批付款关系列表
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<List<PayRelation>> GetPayRelationList([FromQuery]PayRelationListCommand command)
        {
            return await mediator.Send(command);
        }
    }
}
